package com.molichuxing.services.property;

/**
 * @Author: renzhengyu
 * @Description:
 * @Date: Created in 10:08 2019/8/13
 * @Modified By: 经销商订单状态
 **/
public enum OrderDealerStatusEnum {
    /**
     * 创建订单
     */
    CREATE_ORDER(1, "创建订单"),

    /**
     * 待付首付款
     */
    PREPAID_DOWN_PAYMENT(2,"待付首付款"),

    /**
     * 已付首付款
     */
    DOWN_PAYMENT_PAID(3,"已付首付款"),

    /**
     * 等待发车
     */
    WAIT_DEPARTURE(4,"等待发车"),

    /**
     * 等待收车
     */
    WAIT_PICK_UP(5,"等待收车"),

    /**
     * 完成采购
     */
    COMPLETE(6,"完成采购");

    int value;
    String name;

    OrderDealerStatusEnum(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public int getValue() {
        return value;
    }

    public String getName() {
        return name;
    }

    /**
	 * 通过value获取枚举的name
	 * 
	 * @param value
	 * @return
	 */
    public static String getName(int value) {
		OrderDealerStatusEnum enumerate = getEnum(value);
		return enumerate == null ? null : enumerate.getName();
    }

	/**
	 * 通过value获取枚举
	 * 
	 * @param value
	 * @return
	 */
	public static OrderDealerStatusEnum getEnum(int value) {
		for (OrderDealerStatusEnum enumerate : OrderDealerStatusEnum.values()) {
			if (enumerate.getValue() == value) {
				return enumerate;
			}
		}
		return null;
	}

}
